package com.sg.dto.integration.component;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @desc MessagesDto
 * @使用场景
 */
@Data
public class MessagesDto extends BaseDto implements Serializable {

    /**
     * chatGpt消息内容
     */
    @NotNull(message = "chatGpt消息内容不能为空")
    @ApiModelProperty("chatGpt消息内容")
    private String content;

    /**
     * chatGpt消息角色
     */
    @NotNull(message = "chatGpt消息角色不能为空")
    @ApiModelProperty("chatGpt消息角色")
    private String role;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        MessagesDto that = (MessagesDto) o;
        return content == that.content && role == that.role;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), content, role);
    }

}
